package leetcode_2501_2600;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class LeeCode_2545 {
    public static void main(String[] args) {

    }
    private static int[][] sortTheStudents(int[][] score, int k) {
        int m = score.length, n = score[0].length;
        List<int[]> list = new ArrayList<>(Arrays.asList(score));
        Integer[] is = new Integer[m];
        for (int i = 0; i < m; i++) {
            is[i] = i;
        }
        Arrays.sort(is, (o1, o2) -> score[o2][k] - score[o1][k]);
        for (int i = 0; i < m; i++) {
            score[i] = list.get(is[i]);
        }
        return score;
    }
}
